﻿using DevExpress.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace PlaceOrder_Client.Views
{
    /// <summary>
    /// 改价窗体
    /// </summary>
    public partial class ChangePriceView : Window
    {
        public ChangePriceView()
        {
            InitializeComponent();
            Messenger.Default.Register<string>(this, CloseWindow);
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void CloseWindow(string message)
        {
            this.Close();
        }

        private void Window_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            string keyValue = e.Key.ToString();

            switch (keyValue)
            {
                case "Up":
                    this.price1.Value += 0.0005;
                    break;    
                case "Down":  
                    this.price1.Value -= 0.0005;
                    break;
            }
        }

        private void NumericUpDown_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {

        }
    }
}
